# Archlive <http://archlive-pkg.googlecode.com>

EAPI=3

inherit eutils

DESCRIPTION="www.alipay.com security control"
SRC_URI="https://download.alipay.com/alipaysc/linux/aliedit/${PV}/aliedit.tar.gz"

HOMEPAGE="http://www.alipay.com"

SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
LICENSE="ALIPAY"
RESTRICT="strip mirror"
DEPEND="media-libs/libpng"
RDEPEND="sys-apps/gawk"

src_unpack() {
	unpack ${A} || die
	ARCHIVE=$(awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' aliedit.sh)
	tail -n+$ARCHIVE aliedit.sh | tar xzvm -C ./
}

src_install() {
	exeinto /usr/$(get_libdir)/nsbrowser/plugins  #if "inherit eutils"

	if use amd64; then
		#exeinto /usr/lib64/nsbrowser/plugins
		doexe lib/libaliedit64.so || die
	else
		#exeinto /usr/lib32/nsbrowser/plugins
		doexe lib/libaliedit32.so || die
	fi
}
